﻿using Microsoft.Data.SqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EFCoreRepository.Extensions;
using RescueApp.Data;


namespace Rescue.UI.Common
{
    public static class DbHelper
    {
       

        public static bool IsExistsWithORM(RescueContext db, int Id)
        {
            var rescueitems = db.RescueApplies.Where(x => x.RescueID == Id);
            if (rescueitems.Any())
            {
                return true;
            }
            return false;
        }

        public static bool IsExistsWithORM2(RescueContext db, int Id)
        {
            var rescueitems = db.RescueDispatches.Where(x => x.DispatchID == Id);
            if (rescueitems.Any())
            {
                return true;
            }
            return false;
        }
    }
}
